.class public Lcom/brixd/niceapp/model/ShortAppModel;
.super Ljava/lang/Object;
.source "ShortAppModel.java"

# interfaces
.implements Ljava/io/Serializable;


# static fields
.field private static final serialVersionUID:J = -0x7aba93611c89c44bL


# instance fields
.field private author:Lcom/brixd/niceapp/model/CommonUserModel;

.field private digiest:Ljava/lang/String;

.field private id:I

.field private type:Ljava/lang/String;

.field private upTimes:I


# direct methods
.method public constructor <init>()V
    .registers 1

    .prologue
    .line 10
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static parseModel(Lorg/json/JSONObject;)Lcom/brixd/niceapp/model/ShortAppModel;
    .registers 4
    .param p0, "object"    # Lorg/json/JSONObject;

    .prologue
    .line 74
    const/4 v1, 0x0

    .line 75
    .local v1, "model":Lcom/brixd/niceapp/model/ShortAppModel;
    if-eqz p0, :cond_3d

    .line 76
    new-instance v1, Lcom/brixd/niceapp/model/ShortAppModel;

    .end local v1    # "model":Lcom/brixd/niceapp/model/ShortAppModel;
    invoke-direct {v1}, Lcom/brixd/niceapp/model/ShortAppModel;-><init>()V

    .line 77
    .restart local v1    # "model":Lcom/brixd/niceapp/model/ShortAppModel;
    const-string v2, "id"

    invoke-virtual {p0, v2}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;)I

    move-result v2

    invoke-virtual {v1, v2}, Lcom/brixd/niceapp/model/ShortAppModel;->setId(I)V

    .line 78
    const-string v2, "up_times"

    invoke-virtual {p0, v2}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;)I

    move-result v2

    invoke-virtual {v1, v2}, Lcom/brixd/niceapp/model/ShortAppModel;->setUpTimes(I)V

    .line 79
    const-string v2, "type"

    invoke-virtual {p0, v2}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/brixd/niceapp/model/ShortAppModel;->setType(Ljava/lang/String;)V

    .line 80
    const-string v2, "digest"

    invoke-virtual {p0, v2}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 81
    .local v0, "digest":Ljava/lang/String;
    if-nez v0, :cond_2d

    const-string v0, ""

    .end local v0    # "digest":Ljava/lang/String;
    :cond_2d
    invoke-virtual {v1, v0}, Lcom/brixd/niceapp/model/ShortAppModel;->setDigiest(Ljava/lang/String;)V

    .line 82
    const-string v2, "author"

    invoke-virtual {p0, v2}, Lorg/json/JSONObject;->optJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v2

    invoke-static {v2}, Lcom/brixd/niceapp/model/CommonUserModel;->parseUserModel(Lorg/json/JSONObject;)Lcom/brixd/niceapp/model/CommonUserModel;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/brixd/niceapp/model/ShortAppModel;->setAuthor(Lcom/brixd/niceapp/model/CommonUserModel;)V

    .line 85
    :cond_3d
    return-object v1
.end method

.method public static parseModels(Lorg/json/JSONArray;)Ljava/util/List;
    .registers 4
    .param p0, "array"    # Lorg/json/JSONArray;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lorg/json/JSONArray;",
            ")",
            "Ljava/util/List",
            "<",
            "Lcom/brixd/niceapp/model/ShortAppModel;",
            ">;"
        }
    .end annotation

    .prologue
    .line 61
    new-instance v1, Ljava/util/ArrayList;

    invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V

    .line 62
    .local v1, "models":Ljava/util/List;, "Ljava/util/List<Lcom/brixd/niceapp/model/ShortAppModel;>;"
    if-nez p0, :cond_8

    .line 70
    :cond_7
    return-object v1

    .line 66
    :cond_8
    const/4 v0, 0x0

    .local v0, "i":I
    :goto_9
    invoke-virtual {p0}, Lorg/json/JSONArray;->length()I

    move-result v2

    if-ge v0, v2, :cond_7

    .line 67
    invoke-virtual {p0, v0}, Lorg/json/JSONArray;->optJSONObject(I)Lorg/json/JSONObject;

    move-result-object v2

    invoke-static {v2}, Lcom/brixd/niceapp/model/ShortAppModel;->parseModel(Lorg/json/JSONObject;)Lcom/brixd/niceapp/model/ShortAppModel;

    move-result-object v2

    invoke-interface {v1, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 66
    add-int/lit8 v0, v0, 0x1

    goto :goto_9
.end method


# virtual methods
.method public getAuthor()Lcom/brixd/niceapp/model/CommonUserModel;
    .registers 2

    .prologue
    .line 45
    iget-object v0, p0, Lcom/brixd/niceapp/model/ShortAppModel;->author:Lcom/brixd/niceapp/model/CommonUserModel;

    return-object v0
.end method

.method public getDigiest()Ljava/lang/String;
    .registers 2

    .prologue
    .line 37
    iget-object v0, p0, Lcom/brixd/niceapp/model/ShortAppModel;->digiest:Ljava/lang/String;

    return-object v0
.end method

.method public getId()I
    .registers 2

    .prologue
    .line 21
    iget v0, p0, Lcom/brixd/niceapp/model/ShortAppModel;->id:I

    return v0
.end method

.method public getType()Ljava/lang/String;
    .registers 2

    .prologue
    .line 29
    iget-object v0, p0, Lcom/brixd/niceapp/model/ShortAppModel;->type:Ljava/lang/String;

    return-object v0
.end method

.method public getUpTimes()I
    .registers 2

    .prologue
    .line 53
    iget v0, p0, Lcom/brixd/niceapp/model/ShortAppModel;->upTimes:I

    return v0
.end method

.method public setAuthor(Lcom/brixd/niceapp/model/CommonUserModel;)V
    .registers 2
    .param p1, "author"    # Lcom/brixd/niceapp/model/CommonUserModel;

    .prologue
    .line 49
    iput-object p1, p0, Lcom/brixd/niceapp/model/ShortAppModel;->author:Lcom/brixd/niceapp/model/CommonUserModel;

    .line 50
    return-void
.end method

.method public setDigiest(Ljava/lang/String;)V
    .registers 2
    .param p1, "digiest"    # Ljava/lang/String;

    .prologue
    .line 41
    iput-object p1, p0, Lcom/brixd/niceapp/model/ShortAppModel;->digiest:Ljava/lang/String;

    .line 42
    return-void
.end method

.method public setId(I)V
    .registers 2
    .param p1, "id"    # I

    .prologue
    .line 25
    iput p1, p0, Lcom/brixd/niceapp/model/ShortAppModel;->id:I

    .line 26
    return-void
.end method

.method public setType(Ljava/lang/String;)V
    .registers 2
    .param p1, "type"    # Ljava/lang/String;

    .prologue
    .line 33
    iput-object p1, p0, Lcom/brixd/niceapp/model/ShortAppModel;->type:Ljava/lang/String;

    .line 34
    return-void
.end method

.method public setUpTimes(I)V
    .registers 2
    .param p1, "upTimes"    # I

    .prologue
    .line 57
    iput p1, p0, Lcom/brixd/niceapp/model/ShortAppModel;->upTimes:I

    .line 58
    return-void
.end method
